package com.dao.qsl;

import com.util.qsl.Dbutil;
import org.springframework.stereotype.Repository;

import java.sql.Connection;
import java.sql.PreparedStatement;

@Repository
public class HdXg {
      public  Boolean hdxg(int hdxh,String hdkssj,String hdjssj,String hdzt){

	  Dbutil d=new Dbutil();

	  Connection c=null;

	  try {
	        c=d.getConnection();
	        String sql="UPDATE community SET startDate=?, endDate=? ,zt=? WHERE cid=?";
	        PreparedStatement pr=c.prepareStatement(sql);

	        pr.setString(1,hdkssj);
	        pr.setString(2,hdjssj);
	        pr.setString(3,hdzt);
	        pr.setInt(4,hdxh);

	        int i=pr.executeUpdate();

	        if(i>0){
		    return  true;
	        }else{
		    return false;
	        }
	  }catch (Exception e){
	        e.printStackTrace();
	  }
	return false;
      }
}
